# $Id: PKGBUILD 88450 2013-04-17 23:15:57Z eric $
# Maintainer: Justin Davis (juster) <jrcd83@gmail.com>

pkgname=perlbrew
pkgver=0.62
pkgrel=1
pkgdesc='Manage perl installations in your $HOME'
arch=('any')
url="https://metacpan.org/release/App-perlbrew"
license=('MIT')
depends=('perl' 'perl-capture-tiny' 'perl-cpan-perl-releases' 'perl-devel-patchperl'
         'perl-file-path-tiny' 'perl-local-lib')
makedepends=('perl-extutils-makemaker')
checkdepends=('perl-test-exception' 'perl-test-output' 'perl-test-spec' 
              'perl-path-class' 'perl-io-all')
provides=("perl-app-perlbrew=$pkgver")
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/G/GU/GUGOD/App-perlbrew-$pkgver.tar.gz")
sha1sums=('715ad4852e9989bb1af7d9941e7e3290a3aaba41')

build() {
  cd App-perlbrew-$pkgver
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  unset PERL5LIB PERL_MM_OPT
  perl Makefile.PL
  make
}

check() {
  cd App-perlbrew-$pkgver
  export PERL_MM_USE_DEFAULT=1
  unset PERL5LIB
  make test
}

package() {
  cd App-perlbrew-$pkgver
  make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
  install -D -m 644 LICENSE "$pkgdir"/usr/share/licenses/perlbrew/LICENSE
}
